package com.mxf.code.template_method.test01;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * Copyright (C), 2017-2022, mxf
 * Author: 28382
 * Date: 2022/10/13 15:56
 * FileName: TestTemplateMethodController
 * Description: 测试模板模式
 */
@RestController
@RequestMapping("testTemplateMethodController")
public class TestTemplateMethodController2 {

    @Autowired
    @Qualifier("SubCallback01")
    private Callback callback01;

    @Autowired
    @Qualifier("SubCallback02")
    private Callback callback02;

    @Resource
    private Template template;

    @GetMapping("doTest01")
    public void doTest01(){
        template.templateMethod(callback01);
    }
    @GetMapping("doTest02")
    public void doTest02(){
        template.templateMethod(callback02);
    }
}
